﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using nwrole.toolbox.sync;
using nwrole.toolbox.sync.entity;

namespace sync_test.maps
{
    public class TEXTER
    {
        public static SyncEntity Mapping
        {
            get
            {
                var map = new SyncEntity();

                map.Name = "FAST_TEXTER";
                map.SourceTableName = "TEXTER_CLOB";
                map.ShadowTableName = "jfh_bo.TEXTER_GHOST";
                map.DestinationTableName = "int_TEXTER";

                map.AddColumn(
                    new SyncEntityColumn()
                    {
                        SortIndex = 0,
                        ColumnName = "TEXTERID",
                        CSharpType = "System.Decimal",
                        PrimaryKey = true,
                        SourceSqlTypeName = "INTEGER",
                        SourceSqlTypeNullableBool = false,
                        DestSqlTypeName = "int",
                        DestSqlTypeNullableBool = false,
                    }
                );

                map.AddColumn(
                    new SyncEntityColumn()
                    {
                        SortIndex = 1,
                        ColumnName = "RELID",
                        CSharpType = "System.Decimal",
                        SourceSqlTypeName = "INTEGER",
                        SourceSqlTypeNullableBool = false,
                        DestSqlTypeName = "int",
                        DestSqlTypeNullableBool = false,
                    }
                );

                map.AddColumn(
                    new SyncEntityColumn()
                    {
                        SortIndex = 2,
                        ColumnName = "TEXT_CLOB",
                        CSharpType = "System.String",
                        SourceSqlTypeName = "VARCHAR2(4000 BYTE)",
                        SourceSqlTypeNullableBool = true,
                        DestSqlTypeName = "nvarchar(MAX)",
                        DestSqlTypeNullableBool = true,
                    }
                );

                map.AddColumn(
                    new SyncEntityColumn()
                    {
                        SortIndex = 3,
                        ColumnName = "TEXTERTYPID",
                        CSharpType = "System.Decimal",
                        SourceSqlTypeName = "INTEGER",
                        SourceSqlTypeNullableBool = false,
                        DestSqlTypeName = "int",
                        DestSqlTypeNullableBool = false,
                    }
                );

                return map;
            }
        }
    }
}
